package com.iwop.moto.service.impl;

import com.iwop.moto.comm.Page;
import com.iwop.moto.dao.MCashBackConfigMapper;
import com.iwop.moto.model.MCashBackConfig;
import com.iwop.moto.service.MCashBackConfigService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("mCashBackConfigService")
public class MCashBackConfigServiceImpl implements MCashBackConfigService {
 
	@Resource
	private MCashBackConfigMapper mCashBackConfigMapper;
	
	public MCashBackConfig searchById(Integer sid){
		return mCashBackConfigMapper.selectByPrimaryKey(sid);
	}
	
	@Transactional
	public int insert(MCashBackConfig mCashBackConfig) {
		return mCashBackConfigMapper.insert(mCashBackConfig);
	}
	
	@Transactional
	public int update(MCashBackConfig mCashBackConfig) {
		return mCashBackConfigMapper.updateByPrimaryKey(mCashBackConfig);
	}
	
	@Transactional
	public int delete(Integer sid){
		return mCashBackConfigMapper.deleteByPrimaryKey(sid);
	}

    @Override
    public MCashBackConfig findByOrderMoney(double orderMoney,String cash_type) {
        return mCashBackConfigMapper.findByOrderMoney(orderMoney,cash_type);
    }


}